''' 算术运算符重载2 '''


class Mynumber():

    def __init__(self,data=[]):
        self.data = data

    def __repr__(self):
        return f"Mynumber({self.data})"

    def __add__(self, other):
        return self.data + other.data

    def __sub__(self, other):
        return self.data - other.data

    def __mul__(self, rhs):
        return self.data * rhs

    def __mod__(self, other):

        return self.data % other.data

    def __floordiv__(self, other):
        return self.data // other.data

    def __truediv__(self, other):
        return self.data / other.data

    def __rmul__(self, lhs):
        return lhs*self.data

    def __iadd__(self, rhs):
        self.data += rhs
        return self

    def __ipow__(self, other):
        self.data **= other
        return self

    def __lt__(self, other):
        return self.data < other.data

    def __ge__(self, other):
        return self.data >= other.data


n1 = Mynumber(2)
n2 = Mynumber(5)

print(n1*2)
print(2*n1)
# //地板除，取整不保留小数也不会四舍五入
print(n2//n1)
print(n2/n1)

n1 += 3
print(n1)

n2 **= 2
print(n2)

print(n1 > n2)
print(n1 >= n2)
